package com.example.seckilldemo.controller;


import com.example.seckilldemo.pojo.User;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Api(tags = "商品接口")
@Controller
@RequestMapping("/goods")
public class GoodsController extends BaseController{

    @RequestMapping(value = "/toList",method = RequestMethod.GET)
    public String toList( Model model,User user){
//        if(StringUtils.isEmpty(ticket)){
//            return "login";
//        }
////        User user = (User) session.getAttribute(ticket);
//        User user = userService.getUserByCookie(ticket, request, response);
//        if(null == user){
//            return "login";
//        }
        model.addAttribute("user",user);
        return "goodsList";
    }
}
